package cn.com.sise.service.impl;

import cn.com.sise.dao.ResourcesDao;
import cn.com.sise.pojo.Resources;
import cn.com.sise.service.ResourcesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResourcesServiceImpl implements ResourcesService {
    private ResourcesDao resourcesDao;

    @Autowired
    public void setResourcesDao(ResourcesDao resourcesDao) {
        this.resourcesDao = resourcesDao;
    }

    public int insertResource(Resources resources) {
        return resourcesDao.insertResource(resources);
    }

    public int deleteResource(Resources resources) {
        return resourcesDao.deleteResource(resources);
    }

    public int updateResource(Resources resources) {
        return resourcesDao.updateResource(resources);
    }

    public List<Resources> selectResourceByClassification(Resources resources) {
        return resourcesDao.selectResourceByClassification(resources);
    }

    public List<Resources> selectResourceByName(Resources resources) {
        return resourcesDao.selectResourceByName(resources);
    }

    public List<Resources> selectResourcesPage(int start, int count) {
        return resourcesDao.selectResourcesPage(start, count);
    }

    public int getResourcesTotal() {
        return resourcesDao.getResourcesTotal();
    }

    public Resources selectResourcesById(int resource_id) {
        return resourcesDao.selectResourcesById(resource_id);
    }

    public boolean selectResourcesByRCode(String r_Code) {
        return resourcesDao.selectResourcesByRCode(r_Code) == null;
    }

    public List<Resources> getAllResource() {
        return resourcesDao.getAllResource();
    }

}
